<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>  
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>保修列表</title>

<script type="text/javascript" src="../../../js/jquery-1.3.1.js"></script>
<script type="text/javascript" src="../../../js/jquery-ui-personalized-1.6rc6.min.js"></script>
<script type="text/javascript" src="../js/dormSupervisor.js"></script>
<link type="text/css" href="../../../style/theme/ui.all.css" rel="stylesheet" />
</head>
<body>
	
	<h1>${dormSupervisor.building.name}的保修列表</h1>
	<c:choose>
		<c:when test="${!empty repairs.list}">
			<table id="repairs">
		    	<thead><tr><th>保修表</th></tr></thead>
		    	<tbody>
		    		<c:forEach items="${repairs.list}" var="repair">
			        <tr>
			        	<td>ID：${repair.id }</td>
			        	<td>原因：${repair.reason }</td>
			        	<td>请求日期：<fmt:formatDate value="${repair.requestDate}" dateStyle="LONG" type="both"/></td>
			        	<td>寝室：${repair.dormitory.name }</td>
			        	<td>受理状态：<input type="checkbox" value="${repair.id }" 
			        						name="processed" 
			        						${repair.status.processed ?  "checked='checked'" : "" }/>
			        	处理状态：<input type="checkbox" value="${repair.id }" 
			        						name="applied" 
			        						${repair.status.applied ? "checked='checked'" : "" }/>
			        		<button class="deleteButton" name="deleteRepair" value="${repair.id}">删除</button>
			        		
			        	</td>
			        						
			        </tr>
		       		</c:forEach>
		        </tbody>
		        <div class="confirm"><p></p></div>
		        <div class="returnMessage"><p></p></div>
		    </table>
  		</c:when>
		<c:otherwise>
			<p>列表为空</p>
		</c:otherwise>
	</c:choose>
</body>
</html>